feat: Implement python-decouple for environment variables management #187
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces the use of
python-decoupleto manage the environment variables of the Django-CRM project. It also updates the installation and configuration documentation to reflect this change.Motivation:
Security: Storing sensitive information (such as API keys, database credentials) outside the source code, in a
.envfile, increases the security of the project.Flexibility: Makes it easier to configure the project in different environments (development, testing, production) without changing the code.
Organization: Centralizes the configurations in a
.envfile, making management simpler and more organized.Consistency: Ensures that environment variables are loaded consistently across all environments.
Change Details:
python-decouple:python-decoupletorequirements.txt..envFile:.envfile (contrib/env-sample) to serve as a template..envfile have been added to the documentation.settings.py:webcrm/settings.pyfile has been updated to usepython-decoupleto read environment variables.config()have been added to the documentation..gitignore:.envto.gitignoreto prevent sensitive information from being sent to the repository.python-decouple".dj-database-urlhas been added to make database configuration easier.Impact:
Testing:
Local testing has been performed to ensure that the project works correctly with the new settings.
Checklist:
python-decoupleinstalled and configured..envfile created and configured.settings.pyupdated to usepython-decouple..envadded to.gitignore.dj-database-urlinstalled and configured.